package com.wbp.cms.qatest.dao;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.junit.Test;

import com.wbp.cms.client.project.domain.ProjectProfitDO;
import com.wbp.cms.client.project.query.ProjectProfitQuery;
import com.wbp.cms.core.project.dao.ProjectProfitDAO;
import com.wbp.cms.qatest.BaseTest;


/**
 * @Description: 
 * @Department:
 * @author andy.lhc
 * @date 2016年3月11日 下午11:40:09 
 */
public class ProjectProfitDAOTest extends BaseTest {

  @Resource(name="projectProfitDAO")
  private ProjectProfitDAO  projectProfitDAO ;
  
   @Test
   public void  test_insert01(){
   
     ProjectProfitDO  pp = new ProjectProfitDO();
     pp.setComments("test");
     pp.setProjectId(1L);
     pp.setStartTime(new Date());
     pp.setEndTime(new Date(new Date().getTime()+36000 *30 ));
     pp.setRunningDate(10); 
     pp.setPreAmount(new BigDecimal(66.77d));
     
     System.out.println(  projectProfitDAO.insert(pp) >0 ) ;
     
   }
  
   @Test
   public void  test_insert02(){
   
     ProjectProfitDO  pp = new ProjectProfitDO();
     pp.setComments("test");
     pp.setProjectId(1L);
     pp.setStartTime(new Date());
     pp.setEndTime(new Date(new Date().getTime()+36000 *5000 ));
     pp.setRunningDate(20); 
     pp.setPreAmount(new BigDecimal(345.77d));
     
     System.out.println(  projectProfitDAO.insert(pp) >0 ) ;
     
   }
   
   @Test
   public void test_query(){
      List<ProjectProfitDO> list = this.projectProfitDAO.queryByProjectId(1L) ;
      System.out.println("size: " + list.size() );
      System.out.println("list: " + list );
   }
  
   @Test
   public void test_query2(){
      ProjectProfitQuery  pp = new ProjectProfitQuery();
      pp.setProjectId(1L);
      List<ProjectProfitDO> list = this.projectProfitDAO.query(pp) ;
      System.out.println("size: " + list.size() );
      System.out.println("list: " + list );
   }
  
  
}
